package org.getOffer;

/**
 * @Author yu
 * @Date 2021/6/4
 */
public class Practice03 {

    public static void main(String[] args) {

        int[] ints={2, 3, 1, 0, 2, 5, 3};
        System.out.println(findRepeatNumber(ints));

        String str = "      ";
        String substring = str.substring(0, 1);

        System.out.println(substring.equals(" "));

        System.out.println("----------------"+str.substring(0, 1)+"===="+" "+"------------------");

    }

    public static int findRepeatNumber(int[] nums) {
        int[] arr=new int[nums.length];
        int j=0;
        for (int i : nums) {
            if (arr[i]!=0){
                j=i;
                break;
            }
            arr[i]++;
        }
        return j;

    }

}
